import Taro, {Component, Config} from '@tarojs/taro'
import { View } from '@tarojs/components'
import { APP_SYSTEM_INFO } from "@/config/config"
import { verifyType } from "@/utils/utils"

export default class Index extends Component {
  state: any
  config: Config = {
    navigationBarTitleText: '系统信息'
  }

  constructor() {
    super(...arguments)
    this.state = {}
  }

  render() {
    const keys = Object.keys(APP_SYSTEM_INFO)
    return (
      <View className='page'>
        {
          keys.map((name, key) => {
            const item = APP_SYSTEM_INFO[name]
            const list = verifyType(item, 'Object') && Object.keys(item) || []
            return (<View key={key}>
              <View className=''>{name}：{item}</View>
              {list.map(str => {
                return (<View key={str}>
                  {str}：{item[str]}
                </View>)
              })}
            </View>)
          })
        }
      </View>
    )
  }
}
